package cn.itsource.ymjs.api;

import cn.itsource.ymjs.constants.APIConstants;
import cn.itsource.ymjs.doc.CourseDoc;
import cn.itsource.ymjs.fallback.CourseDocFallBackFactory;
import cn.itsource.ymjs.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 用openfeign暴露接口
 * value:表示从负载均衡中调用那个服务 fallbackFactory:表示熔断回调
 * @program: hrm-parent
 * @author: Mr.Zhang
 * @create: 2022-01-10 00:15
 **/
@FeignClient(value = APIConstants.NAME_SERVICE_COURSEDOC,fallbackFactory = CourseDocFallBackFactory.class)
@RequestMapping("/courseDoc")
public interface CourseDocAPI {

    @PostMapping("/add")
    AjaxResult batchAdd(@RequestBody List<CourseDoc> docs);

    @PostMapping("/del")
    AjaxResult batchDel(@RequestBody List<Long> ids);
}
